home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / windownt / dyndlg.zip / FORMAT.TXT < prev    next >
INI File  |  1992-11-02  |  5KB  |  128 lines

  1. [Excerpt from resfmt.zip...]
  2.  
  3. 4.3  Dialog Box Resources
  4.  
  5. A dialog box is contained in a single resource and has a
  6. header and a portion repeated for each control in the dialog
  7. box.  The header is as follows:
  8.  
  9.     [Resource header (type = 5)]
  10.     
  11. struct DialogBoxHeader {
  12.   DWORD  lStyle;
  13.   DWORD  lExtendedStyle;     // new for NT
  14.   WORD   NumberOfItems;
  15.   WORD   x;
  16.   WORD   y;
  17.   WORD   cx;
  18.   WORD   cy;
  19.   [Name or Ordinal] MenuName;
  20.   [Name or Ordinal] ClassName;
  21.   WCHAR  szCaption[];
  22.   WORD   wPointSize;         // Only here if FONT set for dialog
  23.   WCHAR  szFontName[];       // This too
  24.   };
  25.   
  26. The item DWORD lStyle is a standard window style composed of
  27. flags found in WINDOWS.H.    The default style for a dialog
  28. box is:
  29.  
  30.     WS_POPUP | WS_BORDER | WS_SYSMENU
  31.     
  32. The lExtendedStyle DWORD is used to specify the extended
  33. window style flags.  If an extended style is specified on
  34. the DIALOG statement, or with the other optional modifier
  35. statements, this DWORD is set to that value.
  36.  
  37. The items marked `Name or Ordinal' are the same format used
  38. throughout the resource file (most notably in each resource
  39. header) to store a name or an ordinal ID.  As before, if the
  40. first word is an 0xffff, the next two bytes contain an
  41. ordinal ID.  Otherwise, the first 1 or more WORDS contain a
  42. double-null-terminated string.  An empty string is
  43. represented by a single WORD zero in the first location.
  44.  
  45. The WORD wPointSize and WCHAR szFontName entries are present
  46. if the FONT statement was included for the dialog box.  This
  47. can be detected by checking the entry lStyle.  if lStyle &
  48. DS_SETFONT (DS_SETFONT = 0x40), then these entries will be
  49. present.
  50.  
  51. The data for each control starts on a DWORD boundary (which
  52. may require some padding from the previous control), and its
  53. format is as follows:
  54.  
  55. struct ControlData {
  56.   DWORD  lStyle;
  57.   DWORD  lExtendedStyle;
  58.   WORD   x;
  59.   WORD   y;
  60.   WORD   cx;
  61.   WORD   cy;
  62.   WORD   wId;
  63.   [Name or Ordinal] ClassId;
  64.   [Name or Ordinal] Text;
  65.   WORD   nExtraStuff;
  66.   };
  67.     
  68. As before, the item DWORD lStyle is a standard window style
  69. composed of the flags found in WINDOWS.H.  The type of
  70. control is determined by the class.  The class is either
  71. given by a zero-terminated string, or in the case of many
  72. common Windows classes, is given a one word code to save
  73. space and speed processing - in this case, the ordinal
  74. number will be a WORD in length, but only the lower byte
  75. will be used.  Because UNICODE allows 0x8000 as a legal
  76. character, the ordinal classes are prefaced with a of
  77. 0xFFFF, similar to the ordinal Type and Name fields.  The
  78. one byte classes are listed here:
  79.  
  80.     #define    BUTTON              0x80
  81.     #define    EDIT                0x81
  82.     #define    STATIC              0x82
  83.     #define    LISTBOX             0x83
  84.     #define    SCROLLBAR           0x84
  85.     #define    COMBOBOX            0x85
  86.     
  87. The lExtendedStyle DWORD is used to specify the extended
  88. style flags to be used for this control.  The extended style
  89. flags are placed at the end of the CONTROL (or other control
  90. statements) statement following the coordinates
  91.  
  92. The extra information at the end of the control data
  93. structure is currently not used, but is intended for extra
  94. information that may be needed for menu items in the future.
  95. Usually it is zero length.
  96.  
  97. The various statements used in a dialog script are all
  98. mapped to these classes along with certain modifying styles.
  99. The values for these styles can be found in WINDOWS.H.  All
  100. dialog controls have the default styles of WS_CHILD and
  101. WS_VISIBLE.  A list of the default styles used to make the
  102. script statements follows:
  103.  
  104. Statement       Default Class  Default Styles
  105.  
  106.     CONTROL         None           WS_CHILD | WS_VISIBLE
  107.     LTEXT           STATIC         ES_LEFT
  108.     RTEXT           STATIC         ES_RIGHT
  109.     CTEXT           STATIC         ES_CENTER
  110.     LISTBOX         LISTBOX        WS_BORDER | LBS_NOTIFY
  111.     CHECKBOX        BUTTON         BS_CHECKBOX | WS_TABSTOP
  112.     PUSHBUTTON      BUTTON         BS_PUSHBUTTON | WS_TABSTOP
  113.     GROUPBOX        BUTTON         BS_GROUPBOX
  114.     DEFPUSHBUTTON   BUTTON         BS_DEFPUSHBUTTON | WS_TABSTOP
  115.     RADIOBUTTON     BUTTON         BS_RADIOBUTTON
  116.     AUTOCHECKBOX    BUTTON         BS_AUTOCHECKBOX
  117.     AUTO3STATE      BUTTON         BS_AUTO3STATE
  118.     AUTORADIOBUTTON BUTTON         BS_AUTORADIOBUTTON
  119.     PUSHBOX         BUTTON         BS_PUSHBOX
  120.     STATE3          BUTTON         BS_3STATE
  121.     EDITTEXT        EDIT           ES_LEFT | WS_BORDER | WS_TABSTOP
  122.     COMBOBOX        COMBOBOX       None
  123.     ICON            STATIC         SS_ICON
  124.     SCROLLBAR       SCROLLBAR      None
  125.     
  126. The control text is stored in the `Name or Ordinal' format
  127. described in detail above.
  128.